package com.riant.dayo2.demo6;

/**
 * @Classname User
 * @Description TODO
 * @Date 2021/2/28 0:26
 * @Created by 张斌
 */
public class User implements Comparable<User>,Cloneable{
    private int id;
    private String name;
    private int age;


    @Override
    public int compareTo(User o) {
        if(null==o){
            return 1;
        }
        if (this.id < o.id){
            return -1;
        }else if(this.id == o.id){
            return 0;
        }else{
            return 1;
        }

    }
}
